#include "stdafx.h"
#include "Aircraft.h"

void Aircraft::ParseDictionary(Dictionary p_Dictionary)
{
	Dictionary::iterator p = p_Dictionary.begin();
	Name = p->second; p++;
	FClimb = atoi(p->second.c_str()); p++;
	FDesc = atoi(p->second.c_str()); p++;
	VClimbMin = atoi(p->second.c_str()); p++;
	VClimbMax = atoi(p->second.c_str()); p++;
	VClimb = atoi(p->second.c_str()); p++;
	VDescMin = atoi(p->second.c_str()); p++;
	VDescMax = atoi(p->second.c_str()); p++;
	VDesc = atoi(p->second.c_str()); p++;
	CruiseMin = atoi(p->second.c_str()); p++;
	CruiseMax = atoi(p->second.c_str()); p++;
	Cruise = atoi(p->second.c_str()); p++;
	AccelMin = (float) atof(p->second.c_str()); p++;
	AccelMax = (float) atof(p->second.c_str()); p++;
	Accel = (float) atof(p->second.c_str()); p++;
	DecelMin = (float) atof(p->second.c_str()); p++;
	DecelMax = (float) atof(p->second.c_str()); p++;
	Decel = (float) atof(p->second.c_str()); p++;
	LevelMax = (float) atof(p->second.c_str()); p++;
	LevelMin = (float) atof(p->second.c_str()); p++;
	Level = (float) atof(p->second.c_str()); p++;
	Wake = p->second[0]; p++;
}

std::string Aircraft::Key()
{
	return Name;
}

void Aircraft::Print()
{
	std::cout << "Name: " << Name << std::endl;
	std::cout << "Forward Climb Speed: " << FClimb << std::endl;
	std::cout << "Forward Descent Speed: " << FDesc << std::endl;
	std::cout << "Vertical Climb Speed Minimum: " << VClimbMin << std::endl;
	std::cout << "Vertical Climb Speed Maximum: " << VClimbMax << std::endl;
	std::cout << "Vertical Climb: " << VClimb << std::endl;
	std::cout << "Vertical Descent Speed Minimum: " << VDescMin << std::endl;
	std::cout << "Vertical Descent Speed Maximum: " << VDescMax << std::endl;
	std::cout << "Vertical Descent: " << VDesc << std::endl;
	std::cout << "Cruising Speed Minimun: " << CruiseMin << std::endl;
	std::cout << "Cruising Speed Maximum: " << CruiseMax << std::endl;
	std::cout << "Cruising Speed: " << Cruise << std::endl;
	std::cout << "Acceleration Minimum: " << AccelMin << std::endl;
	std::cout << "Acceleration Maximum: " << AccelMax << std::endl;
	std::cout << "Acceleration: " << Accel << std::endl;
	std::cout << "Deceleration Minimum: " << DecelMin << std::endl;
	std::cout << "Deceleration Maximum: " << DecelMax << std::endl;
	std::cout << "Deceleration: " << Decel << std::endl;
	std::cout << "Level Maximum: " << LevelMax << std::endl;
	std::cout << "Level Minimum: " << LevelMin << std::endl;
	std::cout << "Level: " << Level << std::endl;
	std::cout << "Wake: " << Wake << std::endl;
	std::cout << "------------------------------" << std::endl;
}

AircraftMap::AircraftMap() : AdaptationMap<Aircraft>(AIRCRAFTADAPTFILENAME)
{
}
